home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu379.dms / pu379.adf / SuperRetLab / abouthelp.c < prev    next >
C/C++ Source or Header  |  1990-07-02  |  6KB  |  204 lines

  1. /*
  2.  * abouthelp.c : file containing about(), and help(), as well as
  3.  *    all the text structs for autorequesters.
  4.  */
  5.  
  6. extern struct Window *wG;
  7. extern struct TextAttr TOPAZ80;
  8.  
  9. /*
  10.  *    Data describing the requestor text
  11.  *
  12.  */
  13.  
  14. struct IntuiText oktxt = {
  15.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  16.     5,3,    /* XY origin relative to container TopLeft */
  17.     &TOPAZ80,    /* font pointer or NULL for default */
  18.     (UBYTE *)"OK",    /* pointer to text */
  19.     NULL    /* next IntuiText structure */
  20. };
  21.  
  22. struct IntuiText parfailtxt = {
  23.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  24.     14,16,    /* XY origin relative to container TopLeft */
  25.     &TOPAZ80,    /* font pointer or NULL for default */
  26.     (UBYTE *)"Parallel failed to open",    /* pointer to text */
  27.     NULL    /* next IntuiText structure */
  28. };
  29.  
  30. struct IntuiText prerrtxt2 = {
  31.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  32.     14,32,    /* XY origin relative to container TopLeft */
  33.     &TOPAZ80,    /* font pointer or NULL for default */
  34.     (UBYTE *) NULL,    /* filled in from sys_errlist */
  35.     NULL    /* next IntuiText structure */
  36. };
  37.  
  38. struct IntuiText prerrtxt = {
  39.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  40.     14,16,    /* XY origin relative to container TopLeft */
  41.     &TOPAZ80,    /* font pointer or NULL for default */
  42.     (UBYTE *) "Error Encountered During Printing:",
  43.     &prerrtxt2    /* next IntuiText structure */
  44. };
  45.  
  46. struct IntuiText badcoptxt = {
  47.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  48.     14,16,    /* XY origin relative to container TopLeft */
  49.     &TOPAZ80,    /* font pointer or NULL for default */
  50.     (UBYTE *)"Invalid Number of COPIES",    /* pointer to text */
  51.     NULL    /* next IntuiText structure */
  52. };
  53.  
  54. struct IntuiText prfailtxt = {
  55.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  56.     14,16,    /* XY origin relative to container TopLeft */
  57.     &TOPAZ80,    /* font pointer or NULL for default */
  58.     (UBYTE *)"Printer failed to open",    /* pointer to text */
  59.     NULL    /* next IntuiText structure */
  60. };
  61.  
  62.  
  63.  
  64. struct IntuiText cantxt = {
  65.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  66.     5,3,    /* XY origin relative to container TopLeft */
  67.     &TOPAZ80,    /* font pointer or NULL for default */
  68.     (UBYTE *)"CANCEL",    /* pointer to text */
  69.     NULL    /* next IntuiText structure */
  70. };
  71.  
  72. struct IntuiText retrytxt = {
  73.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  74.     5,3,    /* XY origin relative to container TopLeft */
  75.     &TOPAZ80,    /* font pointer or NULL for default */
  76.     (UBYTE *)"RETRY",    /* pointer to text */
  77.     NULL    /* next IntuiText structure */
  78. };
  79.  
  80. struct IntuiText aboutmsg4 = {
  81.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  82.     14,40,    /* XY origin relative to container TopLeft */
  83.     &TOPAZ80,    /* font pointer or NULL for default */
  84.     (UBYTE *) "      December 22, 1988",    /* pointer to text */
  85.     NULL    /* next IntuiText structure */
  86. };
  87.  
  88. struct IntuiText aboutmsg3 = {
  89.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  90.     14,30,    /* XY origin relative to container TopLeft */
  91.     &TOPAZ80,    /* font pointer or NULL for default */
  92.     (UBYTE *)  "        by Joel Swank",    /* pointer to text */
  93.     &aboutmsg4 /* next IntuiText structure */
  94. };
  95.  
  96. struct IntuiText aboutmsg2 = {
  97.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  98.     14,20,    /* XY origin relative to container TopLeft */
  99.     &TOPAZ80,    /* font pointer or NULL for default */
  100.     (UBYTE *) "         Version 1.1",
  101.     &aboutmsg3    /* next IntuiText structure */
  102. };
  103.  
  104. struct IntuiText aboutmsg = {
  105.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  106.     14,10,    /* XY origin relative to container TopLeft */
  107.     &TOPAZ80,    /* font pointer or NULL for default */
  108.     (UBYTE *)"  SUPER Return Label Printer",    /* pointer to text */
  109.     &aboutmsg2    /* next IntuiText structure */
  110. };
  111.  
  112. /*    Text for Help Screen    */
  113. char *HelpText[30] = {
  114. "                          Super Return Labels",
  115. "",
  116. "   Super  Return  Label  prints return address labels 3-up on single-wide",
  117. "3.5 inch by 7/16 inch label  stock.  It can use condensed printing to get",
  118. "19 characters per line and condensed-elite to get 23 characters per line.",
  119. "It can also print 3, 4 or 5  lines per label.  Four and  five line labels",
  120. "are printed with superscript characters and partial line advances.",
  121. "   Gadgets are used to select number  of lines  and linesize.  Six string",
  122. "gadgets are  used to  enter the  5 data  lines  and the number of copies.",
  123. "There are PRINT and STOP gadgets to start/stop printing.",
  124. "   The options menu  allows centering to  be turned  on and off.  It also",
  125. "allows selection of the printer type.  Amiga printer uses the PRT: device",
  126. "and should work with any printer. Epson printer  uses the PAR: device and",
  127. "will work  only with Epson  compatible printers.  Only Epson  mode allows",
  128. "4-line or 5-line  labels,  because of the  inability of  the Amiga escape",
  129. "codes to do partial line feeds.",
  130. NULL };
  131.  
  132. /*
  133.  *  Handle help request
  134.  */
  135.  
  136. extern struct NewWindow NewWindowStructure2;
  137. struct Window *wH;
  138. struct RastPort *rpH;
  139.  
  140. struct Window *OpenWindow();
  141. struct IntuiMessage *GetMsg();
  142. struct TextFont *OpenFont();
  143.  
  144. help()
  145. {
  146.     struct IntuiMessage *message;    /* the message from the IDCMP */
  147.     struct TextFont *font;
  148.     ULONG class;
  149.     int i;
  150.  
  151.     font = NULL;
  152.     wH = NULL;
  153.  
  154.     wH = OpenWindow(&NewWindowStructure2);    /* open the window */
  155.     if ( wH == NULL )
  156.         return;
  157.  
  158.     rpH = wH->RPort;    /* get a rastport pointer for the window */
  159.  
  160.     font = OpenFont(&TOPAZ80);
  161.     if (font) SetFont(rpH,font);
  162.     SetAPen(rpH,1L);
  163.  
  164.     for (i=0; i<40; i++)    /* dump the whole help text array */
  165.         {
  166.         if (!HelpText[i]) break;
  167.         Move(rpH,25L,(long) (i+1)*8+12);
  168.         Text(rpH,HelpText[i], (long) strlen(HelpText[i]));
  169.         }
  170.     while(1)
  171.     {
  172.         WaitPort(wH->UserPort);
  173.             while( (message = (struct IntuiMessage *)
  174.                 GetMsg(wH->UserPort) ) != NULL)
  175.             {
  176.                 class = message->Class;
  177.                 ReplyMsg(message);
  178.                 switch (class)
  179.                     {
  180.                     case GADGETUP:
  181.                         goto exit;
  182.                         break;
  183.                     case MENUPICK:
  184.                         continue;
  185.                     }
  186.             }
  187.     } 
  188.   exit:
  189.     if (font) CloseFont(font);
  190.     if (wH) CloseWindow(wH);
  191.  
  192. }
  193.  
  194.  
  195. /*
  196.  *  Handle 'about' request
  197.  */
  198.  
  199.  
  200. about()
  201. {
  202.     AutoRequest(wG,&aboutmsg,0L,&oktxt,0L,0L,300L,75L);
  203. }
  204.